package com.kl.feign;

import com.kl.domain.LineDTO;
import com.kl.domain.LineLogisticsStoreDTO;
import com.kl.domain.LogisticsStoreDTO;
import com.kl.em.Result;
import com.kl.feign.fallback.LineServcieFeignFallback;
import com.kl.vo.RouteVO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "kunlun-line-service-a",fallback = LineServcieFeignFallback.class)//服务名找项目
public interface LineServcieFeign {

    //根据ID进行查询
    @GetMapping("/lineController")
    Result<LineDTO> selectById(@RequestParam("id") Long id);

    //路线信息查询接口   传入 起点城市，终点城市
    @GetMapping("/lineController/selectByBoth")
    Result<LineDTO> selectByBoth(@RequestParam("statrAddress") String statrAddress,@RequestParam("endAddress") String endAddress);

    //同城路线信息查询接口
    @GetMapping("/lineController/selectNameCity")
    Result<RouteVO> selectNameCity(@RequestParam("statrAddress") String statrAddress, @RequestParam("endAddress") String endAddress);

    //路线信息增加接口
    @PostMapping("/lineController")
    Result insertById(@RequestParam("statrAddress") String statrAddress,@RequestParam("endAddress") String endAddress);

    //路线信息删除接口
    @DeleteMapping("/lineController")
    Result deleteByLineId(@RequestParam("id") String id);

    ////增加站点接口
    @PostMapping("/lineController/insertSiteName")
    Result selectCount(@RequestParam("siteName")String siteName,@RequestBody List<LogisticsStoreDTO> resultList);

    //物流信息增加接口
    @PostMapping("/lineLogisticsStoreController")
    Result insertByLLId(@RequestParam("lineId") Long lineId);

    //物流信息查询接口
    @GetMapping("/lineLogisticsStoreController")
    Result<List<LineLogisticsStoreDTO>> selectByLineId(@RequestParam("lineId") Long lineId);

    //物流信息删除接口
    @DeleteMapping("/lineLogisticsStoreController")
    Result deleteByLineId(@RequestParam("lineId") Long lineId);

    //物流信息查询下一个站点接口   返回的是下一条站点所在的实体类   .logistics_store_id
    @GetMapping("/lineLogisticsStoreController/selectNextByLineId")
    Result<LineLogisticsStoreDTO> selectNextByLineId(@RequestParam("lineId") Long lineId,@RequestParam("logisticsStoreId")Long logisticsStoreId);
}
